-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[24.1] Fix empty usernames in database + bug in username generation #18379
[24.1] Fix empty usernames in database + bug in username generation #18379
Conversation
The packages error is an import error ( |
I have dropped the unit test for now (it passed) - I'll add it in a separate PR targeting dev. For this to be testable from within the data package, the test should not import from managers. In dev, this is easily solvable by moving db-specific functions into the new |
update, | ||
) | ||
|
||
from galaxy.managers.users import username_from_email_with_connection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't import from managers here, that breaks the package structure. Generally speaking it's probably wise to have a fixed copy in the migration so we don't alter migration results accidentally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Otherwise revision details are displayed in list output: INCORRECT: 92fb564c7095 -> ddbdbc40bdc1 (gxy), add workflow_comment table Revision ID: ddbdbc40bdc1 Revises: 92fb564c7095 Create Date: 2023-08-14 13:41:59.442243 987ce9839ecb, e93c5d0b47a9 -> 92fb564c7095 (gxy) (mergepoint), Merge alembic heads after pulling external_user_id length extension forward EXPECTED: 92fb564c7095 -> ddbdbc40bdc1 (gxy), add workflow_comment table 987ce9839ecb, e93c5d0b47a9 -> 92fb564c7095 (gxy) (mergepoint), Merge alembic heads after pulling external_user_id length extension forward
The bug was introduced when moving this code to SQLAlchemy 2.0 The statement in generate_next_available_username should be evaluated at each step of the iteration: only then will the new value of `i` result in a new statement.
7f4c0f8
to
51309da
Compare
This is a follow-up to #18364 (ref #18364 (comment)).
I've testing this locally (the CI will run the migration too)
This also fixes a newly-discovered bug introduced in #16724 during migrating db code to SA2.0 (see commit description).
I'll backport the bug fix to 23.2. I'm not targeting this at 23.2 because this has tests that rely on data access testing infrastructure introduced in 24.1.
Question: do we want to apply the same type of fix to the tool_shed database schema and data? If so, I'll add a commit with a TS migration.
How to test the changes?
(Select all options that apply)
License